package la.bbs558.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import la.bbs558.entity.BbsPost;
import la.bbs558.entity.vo.BbsPostVO;
import la.bbs558.entity.params.BbsPostPage;
import la.bbs558.entity.params.BbsSectionPostPage;
import la.bbs558.entity.params.PostSearchPage;
import la.bbs558.entity.params.UserCenterSearchPage;
import org.apache.ibatis.annotations.Param;

/**
 * 发帖(BbsPost)表数据库访问层
 *
 * @author Shanks
 * @since 2023-12-15 22:40:44
 */
public interface BbsPostDao extends BaseMapper<BbsPost> {

    Page<BbsPostVO> selectListByPageForAdmin(@Param("search") PostSearchPage searchPage);

    BbsPostVO selectPostByIdForAdmin(Long id);

    Page<BbsPostVO> searchPostByPage(PostSearchPage searchPage);

    Page<BbsPostVO> queryPostList(BbsPostPage page);

    void updateReplyCnt(@Param("postId") Long postId);

    IPage<BbsPostVO> selectListByUserId(@Param("search") UserCenterSearchPage<BbsPostVO> searchPage);

    BbsPostVO selectPostDetailById(Long postId);

    Page<BbsPostVO> topSectionPostList(BbsSectionPostPage page);
}

